<!DOCTYPE html>
<html>
<body>
<script>
    document.onload = function () {
        document.getElementById("timestamp").value = new Date().getTime();
    }
    function long_to_date(input) {
        var timestamp_in_gmt = Number(input.value);
        var timestamp_in_local = timestamp_in_gmt - new Date().getTimezoneOffset()*60000;
        document.getElementById('timestamp_to_date_in_local').innerHTML = new Date(timestamp_in_local).toString();
    }
</script>

<input type="input" id="timestamp" value="" onkeyup="long_to_date(this)"/><label id="timestamp_to_date_in_local"></label>

</body>
</html>
